{include file="header"}
<div style="padding: 20px;" class="layui-form">
<div class="layui-btn-group" id="admin_set">
   <button  data-method="admin_set" type="button" url="{:url("cate/add")}" class="layui-btn layui-btn-normal"> <i class="layui-icon">&#xe654;</i>添加栏目</button>
  <a href="javascript:void(0);" onclick="location.reload()" class="layui-btn layui-btn-warm"> <i class="layui-icon">&#xe9aa;</i>刷新</a>
</div>
<table class="layui-table">
  <colgroup>
    <col width="100">
    <col width="100">
    <col>
  </colgroup>
  <thead>
    <tr>
      <th>排序</th>
      <th>栏目ID</th>
      <th>栏目名称</th>
      <th>所属模型</th>
      <th>导航显示</th>
      <th>显示</th>
      <th>首页显示</th>
      <th>允许投稿</th>
      <th>管理操作</th>
    </tr> 
  </thead>
  <tbody>
{foreach name=":fun_S('cate',array('tid'=>0),'px desc','1000',1)" item="v" key="k"}
    <tr>
      <th>{$v.px}</th>
      <th>{$v.id}</th>
 
      <th><a target="_blank" href="*URL*/m_{$v.alias}.html">{$v.name}</a></th>
      <th>
        {:fun_sc_p('model', array('id'=>$v['model']), 'name')} - {:fun_sc_p('model', array('id'=>$v['model']), 'title')}
      </th>
      <th>
      <input type="checkbox" lay-skin="switch"  url="{:url("set/updateindex")}?id={$v.id}&m=cate&or=open1"  lay-submit lay-filter="index" value="{$v.id}" lay-text="开启|关闭"  {if condition="$v['open1'] eq 1"}checked{/if}>
      </th>
      <th>
      <input type="checkbox" lay-skin="switch"  url="{:url("set/updateindex")}?id={$v.id}&m=cate&or=open"  lay-submit lay-filter="index" value="{$v.id}" lay-text="开启|关闭"  {if condition="$v['open'] eq 1"}checked{/if}>
      </th>
      <th>
      <input type="checkbox" lay-skin="switch" url="{:url("set/updateindex")}?id={$v.id}&m=cate&or=index" lay-submit lay-filter="index" value="{$v.id}" lay-text="开启|关闭"  {if condition="$v['index'] eq 1"}checked{/if}>
      </th>
      <th>
      	<input type="checkbox" lay-skin="switch" url="{:url("set/updateindex")}?id={$v.id}&m=cate&or=tougao"  lay-submit lay-filter="index" value="{$v.id}" lay-text="开启|关闭"  {if condition="$v['tougao'] eq 1"}checked{/if}>
      </th>
      <th>
      	<div class="layui-btn-group" id="admin_set">
      		 <button  data-method="admin_set" member-id="{$v.id}" url="/admin.php/cate/edit/id/{$v.id}.html" type="button" class="layui-btn layui-btn-lg layui-btn-normal layui-btn-sm"> <i class="layui-icon">&#xe642;</i>修改</button>
      		 <button  member-name="确定要删除 {$v.name} 吗? 删除前请确保该分类下无内容" url="{:url("set/delete")}?id={$v.id}&m=cate" lay-submit lay-filter="delete"  class="layui-btn layui-btn-danger layui-btn-sm"> <i class="layui-icon">&#xe640;</i>删除</button>
        </div>
      </th>
    </tr>
{volist name=":fun_s('cate',array('tid'=>$v['id']),'px desc',100,1)" id="vo"}
    <tr>
      <th>{$vo.px}</th>
      <th>{$vo.id}</th>
      <th><a target="_blank" href="*URL*/m_{$vo.alias}.html">——{$vo.name}</a></th>
      <th>{:fun_sc_p('model', array('id'=>$vo['model']), 'name')} - {:fun_sc_p('model', array('id'=>$vo['model']), 'title')}</th>
      <th>
      <input type="checkbox" lay-skin="switch"  url="{:url("set/updateindex")}?id={$vo.id}&m=cate&or=open1"  lay-submit lay-filter="index" value="{$vo.id}" lay-text="开启|关闭"  {if condition="$vo['open1'] eq 1"}checked{/if}>
      </th>
      <th>
      <input type="checkbox" lay-skin="switch" url="{:url("set/updateindex")}?id={$vo.id}&m=cate&or=open" lay-submit lay-filter="index" value="{$vo.id}" lay-text="开启|关闭"  {if condition="$vo['open'] eq 1"}checked{/if}>
      </th>
      <th>
      <input type="checkbox" lay-skin="switch" url="{:url("set/updateindex")}?id={$vo.id}&m=cate&or=index" lay-submit lay-filter="index" value="{$vo.id}" lay-text="开启|关闭"  {if condition="$vo['index'] eq 1"}checked{/if}>
      </th>
      <th>
      	<input type="checkbox" lay-skin="switch" url="{:url("set/updateindex")}?id={$vo.id}&m=cate&or=tougao" lay-submit lay-filter="index" value="{$vo.id}" lay-text="开启|关闭"  {if condition="$vo['tougao'] eq 1"}checked{/if}>
      </th>
      <th>
      	<div class="layui-btn-group" id="admin_set">
      		 <button  data-method="admin_set" member-id="{$vo.id}" url="/admin.php/cate/edit/id/{$vo.id}.html" type="button" class="layui-btn layui-btn-lg layui-btn-normal layui-btn-sm"> <i class="layui-icon">&#xe642;</i>修改</button>
      		 <button  member-name="确定要删除 {$vo.name} 吗? 删除前请确保该分类下无内容" url="{:url("set/delete")}?id={$vo.id}&m=cate" lay-submit lay-filter="delete"  class="layui-btn layui-btn-danger layui-btn-sm"> <i class="layui-icon">&#xe640;</i>删除</button>
        </div>
      </th>
    </tr>
{/volist}  
{/foreach} 
  </tbody>
</table>
<div>
{include file="footer"}